<?php 
    session_start();
    if(!isset($_SESSION['islogined'])||@$_SESSION['idposition']==3)
        header("location:./Login.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link href="app.css" rel="stylesheet">
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">

</head>
<body>
    <?php include 'header1.php'; ?>
    <div class="container">
        <ol class="breadcrumb path-nav">
            <li><a href="./Home.php">Home</a></li>
            <li><a href="./Staff.php">Staff Management</a></li>
            <li class="active">Add New Member</li>
        </ol>
    </div>
    <div class="container addstaff-form">
        <?php
            if(@$_SESSION['creat_reshow']=='success'){
                echo"<div class='success-modify'>The staff ".@$_SESSION['staff']." creats successfull </div>";
            }
            else if(@$_SESSION['creat_reshow']=='fail_had'){
                echo"<div class='fail-modify'>The staff ".@$_SESSION['staff']." had created</div>";
            }
            else if(@$_SESSION['creat_reshow']=='fail_exit'){
                echo"<div class='fail-modify'>The username ".@$_SESSION['staff']." isn't exit</div>";
            }
        ?>
        <h2 class='form-header'>New Staff Information</h2>
        <form role="form" action="staff_infor_change.php" method="POST">
            <input name='type' value="staff_C" style="display:none;">
            <div class="col-md-4 col-md-offset-1">
                <label>First Name:</label>
                <div class="input-group input-formgroup" >
                    <input name='firstname' type="text" class="form-control " required="required">
                </div>
                <label>Last Name:</label>
                <div class="input-group input-formgroup">
                    <input name='lastname' type="text" class="form-control" required="required">
                </div>
                <label>Title:</label>
                <select name='title' class="form-control">
                    <option>Mr</option>
                    <option>Miss</option>
                    <option>Prof</option>
                </select>
                <label>Username:</label>
                <div class="input-group input-formgroup">
                    <input name='staffname' type="text" class="form-control" required="required">
                </div>
                   
            </div>
            <div name="infor_staff" class="col-md-4 col-md-offset-2">
                <label>Email:</label>
                <div class="input-group input-formgroup">
                    <input name='email' type="email" class="form-control" required="required">
                </div> 
                <label>Position</label>
                <select name='position' class="form-control">
                <?php
                    if($_SESSION['idposition']==1){
                        echo"<option value='1'>Head of Department</option>
                             <option value='2'>Secretory</option>
                             <option value='3'>Academic Staff</option>";
                    }
                    else{
                        echo"<option value='2'>Secretory</option>
                             <option value='3'>Academic Staff</option>";
                    }
                ?>
                    
                </select>
                <label>Work Phone:</label>
                <div class="input-group input-formgroup">
                    <input name='phoneNo' type="number" class="form-control" required="required">
                </div>
                <label>Total Work Hours:</label>
                <div class="input-group input-formgroup">
                    <input name='totalhours' type="number" class="form-control" required="required">
                </div>
            </div>
            <div class="col-md-4 col-md-offset-4 ">         
                <button type="submit" class="btn btn-default btn-lg form-button">Submit</button>
                <button class="btn btn-default btn-lg form-button">Reset</button>
            </div>           
        </form>
    </div>
<script src="jquery-3.0.0.min.js"></script>
<script src="bootstrap.min.js"></script>
</body>
</html>